package com.fz.study.project.controller;


import com.fz.study.project.entity.Result;
import com.fz.study.project.entity.Shop;
import com.fz.study.project.service.ITbShopService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2024-02-26
 */
@RequiredArgsConstructor
@Tag(name = "商品管理")
@RestController
@RequestMapping("/tbShop")
public class ShopController {

    private final ITbShopService shopService;
    @Operation(summary = "查询商户缓存")
    @GetMapping("query/{id}")
    public Result queryById(@PathVariable Long id ){
        return Result.success(shopService.queryById(id));
    }

    @Operation(summary = "更新商户信息")
    @PutMapping("update")
    public Result updateById(@RequestBody Shop shop){
        return Result.success(shopService.updateWithId(shop));
    }
}
